Completed
Pull Request — develop (#217)
by Xaver
34s
created

module.exports   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 172

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
nc 1
dl 0
loc 172
rs 8.2857
nop 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A 0 3 1

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
module.exports = function () {
2
  return {
3
    'reverseGeocodingApi': 'https://nominatim.openstreetmap.org/reverse',
4
    'maxAge': 14,
5
    'maxAgeAlert': 3,
6
    'nodeZoom': 18,
7
    'labelZoom': 13,
8
    'clientZoom': 15,
9
    'nodeAttr': [
10
      // value can be a node attribute (1 depth) or a a function in utils/node with prefix show
11
      {
12
        'name': 'node.status',
13
        'value': 'Status'
14
      },
15
      {
16
        'name': 'node.gateway',
17
        'value': 'Gateway'
18
      },
19
      {
20
        'name': 'node.coordinates',
21
        'value': 'GeoURI'
22
      },
23
      //    {
24
      //      "name": "node.contact",
25
      //      "value": "owner"
26
      //    },
27
      {
28
        'name': 'node.hardware',
29
        'value': function (d, V) {
30
          return V.h('h4', 'dynamic function yeah ' + d.mac.substr(11));
31
        }
32
      },
33
      {
34
        'name': 'node.primaryMac',
35
        'value': 'mac'
36
      },
37
      {
38
        'name': 'node.firmware',
39
        'value': 'Firmware'
40
      },
41
      {
42
        'name': 'node.uptime',
43
        'value': 'Uptime'
44
      },
45
      {
46
        'name': 'node.firstSeen',
47
        'value': 'FirstSeen'
48
      },
49
      {
50
        'name': 'node.systemLoad',
51
        'value': 'Load'
52
      },
53
      {
54
        'name': 'node.ram',
55
        'value': 'RAM'
56
      },
57
      {
58
        'name': 'node.ipAddresses',
59
        'value': 'IPs'
60
      },
61
      {
62
        'name': 'node.update',
63
        'value': 'Autoupdate'
64
      },
65
      {
66
        'name': 'node.site',
67
        'value': 'Site'
68
      },
69
      {
70
        'name': 'node.clients',
71
        'value': 'Clients'
72
      }
73
    ],
74
    'supportedLocale': [
75
      'en',
76
      'de',
77
      'fr',
78
      'ru'
79
    ],
80
    // Color configs
81
    'icon': {
82
      'base': {
83
        'fillOpacity': 0.6,
84
        'opacity': 0.6,
85
        'weight': 2,
86
        'radius': 6,
87
        'className': 'stroke-first'
88
      },
89
      'online': {
90
        'color': '#1566A9',
91
        'fillColor': '#1566A9'
92
      },
93
      'offline': {
94
        'color': '#D43E2A',
95
        'fillColor': '#D43E2A',
96
        'radius': 3
97
      },
98
      'lost': {
99
        'color': '#D43E2A',
100
        'fillColor': '#D43E2A',
101
        'radius': 4
102
      },
103
      'alert': {
104
        'color': '#D43E2A',
105
        'fillColor': '#D43E2A',
106
        'radius': 5
107
      },
108
      'new': {
109
        'color': '#1566A9',
110
        'fillColor': '#93E929'
111
      }
112
    },
113
    'client': {
114
      'wifi24': 'rgba(220, 0, 103, 0.7)',
115
      'wifi5': 'rgba(10, 156, 146, 0.7)',
116
      'other': 'rgba(227, 166, 25, 0.7)'
117
    },
118
    'map': {
119
      'labelNewColor': '#459c18',
120
      'tqFrom': '#F02311',
121
      'tqTo': '#04C714',
122
      'highlightNode': {
123
        'color': '#ad2358',
124
        'weight': 8,
125
        'fillOpacity': 1,
126
        'opacity': 0.4,
127
        'className': 'stroke-first'
128
      },
129
      'highlightLink': {
130
        'weight': 4,
131
        'opacity': 1,
132
        'dashArray': '5, 10'
133
      }
134
    },
135
    'forceGraph': {
136
      'nodeColor': '#fff',
137
      'highlightColor': 'rgba(255, 255, 255, 0.2)',
138
      'labelColor': '#fff',
139
      'tqFrom': '#770038',
140
      'tqTo': '#dc0067'
141
    },
142
    'locate': {
143
      'outerCircle': {
144
        'stroke': false,
145
        'color': '#4285F4',
146
        'opacity': 1,
147
        'fillOpacity': 0.3,
148
        'clickable': false,
149
        'radius': 16
150
      },
151
      'innerCircle': {
152
        'stroke:': true,
153
        'color': '#ffffff',
154
        'fillColor': '#4285F4',
155
        'weight': 1.5,
156
        'clickable': false,
157
        'opacity': 1,
158
        'fillOpacity': 1,
159
        'radius': 7
160
      },
161
      'accuracyCircle': {
162
        'stroke': true,
163
        'color': '#4285F4',
164
        'weight': 1,
165
        'clickable': false,
166
        'opacity': 0.7,
167
        'fillOpacity': 0.2
168
      }
169
    },
170
    'cacheBreaker': '<!-- inject:cache-breaker -->'
171
  };
172
};
173